const { defineConfig } = require('@vue/cli-service')
const ComponentsPlugin = require('unplugin-vue-components/webpack')
const { VantResolver } = require('unplugin-vue-components/resolvers')
const AutoImportPlugin = require('unplugin-auto-import/webpack')

module.exports = defineConfig({
  transpileDependencies: true,
  chainWebpack: config => {
    config.plugin('define').tap(args => {
      args[0]['__VUE_FULL_INSTALLATION_MINIMAL'] = JSON.stringify(false)
      args[0]['__VUE_PROD_HYDRATION_MISMATCH_DETAILS'] = JSON.stringify(false)
      return args
    })
  },
  configureWebpack: {
    plugins: [
      AutoImportPlugin({
        resolvers: [VantResolver()],
      }),
      ComponentsPlugin({
        resolvers: [VantResolver()],
      }),
    ],
  }
})
